public class Java作业2 {
    // 课程ID
    private String courseId;
    // 课程名称
    private String courseName;
    // 课程描述
    private String description;
    // 学分数
    private double credits;
    // 教师
    private String instructor;

    // 构造方法
    public Java作业2(String courseId, String courseName, String description, double credits, String instructor) {
        this.courseId = courseId;
        this.courseName = courseName;
        this.description = description;
        this.credits = credits;
        this.instructor = instructor;
    }

    // Getter和Setter方法
    public String getCourseId() {
        return courseId;
    }

    public void setCourseId(String courseId) {
        this.courseId = courseId;
    }

    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public double getCredits() {
        return credits;
    }

    public void setCredits(double credits) {
        this.credits = credits;
    }

    public String getInstructor() {
        return instructor;
    }

    public void setInstructor(String instructor) {
        this.instructor = instructor;
    }

    // 打印课程信息的方法
    public void print() {
        System.out.println("Course ID: " + courseId);
        System.out.println("Course Name: " + courseName);
        System.out.println("Description: " + description);
        System.out.println("Credits: " + credits);
        System.out.println("Instructor: " + instructor);
    }

    // 主方法，用于测试Course类
    public static void main(String[] args) {
        // 创建一个Course对象
        Java作业2 course = new Java作业2("CS101", "Introduction to Computer Science", 
                                   "An introductory course to computer science.", 3.0, "Dr. Smith");
        // 打印课程信息
        course.print();
    }
}